package controller;
import java.awt.image.*;
import java.io.Serializable;
import java.awt.event.KeyEvent;

public class Preferences implements Serializable
{
        private boolean isMuted;
        private int volume;
        private int leftKey;
        private int rightKey;
        private transient BufferedImage background;
        private transient BufferedImage puckImage;
        private transient BufferedImage barImage;
        
        public Preferences()
        {		
                isMuted = false;
                volume = 50;
                leftKey = KeyEvent.VK_LEFT;
                rightKey = KeyEvent.VK_RIGHT;
                //null yerine default pic. olsun ( pic derken picture)
                background = null;
                puckImage = null;
                barImage = null;
        }
        
        public void load(boolean isMuted, int volume, int leftKey, int rightKey, BufferedImage back, BufferedImage puck, BufferedImage bar)
        {
                this.isMuted = isMuted;
                this.volume = volume;
                this.leftKey = leftKey;
                this.rightKey = rightKey;
                background = back;
                puckImage = puck;
                barImage = bar;
        }
        
        public void mute()
        {
                isMuted = true;
        }
        
        public void unMute()
        {
                isMuted = false;
        }
        
        public void setVolume(int vol)
        {
                if(vol > 100)
                        volume = 100;
                else if(vol < 0)
                        volume = 0;
                else
                        volume = vol;
        }
        
        public int getVolume()
        {
                return volume;
        }
        
        public void setLeft(int key)
        {
                leftKey = key;
        }
        
        public void setRight(int key)
        {
                rightKey = key;
        }
        
        public int getLeft()
        {
                return leftKey;
        }
        
        public int getRight()
        {
                return rightKey;
        }
        
        public void setBackground(BufferedImage image)
        {
                background = image;
        }
        
        public BufferedImage getBackground()
        {
                return background;
        }
        
        public void setPuckImage(BufferedImage image)
        {
                puckImage = image;
        }
        
        public BufferedImage getPuckImage()
        {
                return puckImage;
        }
        
        public void setBarImage(BufferedImage image)
        {
                barImage = image;
        }
        
        public BufferedImage getBarImage()
        {
                return barImage;
        }
        

}